using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Game500.Client.Src
{
  public class Sprite : Renderable
  {
    public Sprite(Texture2D texture)
    {
      Texture = texture;
    }

    public Sprite(Texture2D texture, int width, int height) : this(texture)
    {
      Scale = new Vector2((float)width / texture.Width, (float)height / texture.Height);
    }

    public Texture2D Texture { get; private set; }

    public override Renderable Clone()
    {
      return new Sprite(Texture) {Position = Position, Origin = Origin, Rotation = Rotation, Scale = Scale};
    }

    public override void Render(Renderer renderer)
    {
      renderer.RenderSprite(this);
    }
  }
}